<?xml version="1.0" encoding="utf-8"?>
<WITD application="Work item type editor" version="1.0">
    <WORKITEMTYPE name="Test Task">
        <DESCRIPTION>Tracks test work that needs to be done.</DESCRIPTION>
        <FIELDS>
          <FIELD name="GuidanceLink" refname="Sogeti.TMap.GuidanceLink" type="String">
            <HELPTEXT>http://tmap.codeplex.com</HELPTEXT>
          </FIELD>
            <FIELD name="Id" refname="System.Id" type="Integer" />
            <FIELD name="Title" refname="System.Title" type="String">
                <HELPTEXT>Test Work required</HELPTEXT>
                <REQUIRED />
            </FIELD>
            <FIELD name="Activity" refname="Microsoft.VSTS.Common.Activity" type="String" reportable="dimension">
                <HELPTEXT>Type of work involved</HELPTEXT>
                <SUGGESTEDVALUES>
                    <LISTITEM value="Testing"/>
                </SUGGESTEDVALUES>
            </FIELD>
            <FIELD name="Description" refname="System.Description" type="PlainText" >
                <HELPTEXT>What to do, pointers to resources and inputs, design notes, exit criteria</HELPTEXT>
            </FIELD>
            <FIELD name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure" formula="sum">
                <HELPTEXT>An estimate of the number of units of work remaining to complete this task</HELPTEXT>
            </FIELD>
            <FIELD name="Original Estimate" refname="Microsoft.VSTS.Scheduling.OriginalEstimate" type="Double" reportable="measure" formula="sum">
                <HELPTEXT>Initial value for Remaining Work - set once, when work begins</HELPTEXT>
            </FIELD>
            <FIELD name="Completed Work" refname="Microsoft.VSTS.Scheduling.CompletedWork" type="Double" reportable="measure" formula="sum">
                <HELPTEXT>The number of units of work that have been spent on this task</HELPTEXT>
            </FIELD>
            <FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true">
                <HELPTEXT>The person currently working on this task</HELPTEXT>
                <VALIDUSER />
            </FIELD>
            <FIELD name="Area Path" refname="System.AreaPath" type="TreePath">
                <HELPTEXT>The area of the product to which this task contributes</HELPTEXT>
            </FIELD>
            <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath">
                <HELPTEXT>The iteration within which this task will be completed</HELPTEXT>
            </FIELD>
            <FIELD name="History" refname="System.History" type="History">
                <HELPTEXT>Discussion thread plus automatic record of changes</HELPTEXT>
            </FIELD>
            <FIELD name="State" refname="System.State" type="String">
                <HELPTEXT>Active = work remains to be done. Closed = tested and checked in.</HELPTEXT>
            </FIELD>
            <FIELD name="Reason" refname="System.Reason" type="String">
                <HELPTEXT>The reason why the task is in its current state.</HELPTEXT>
            </FIELD>
            <FIELD name="Priority" refname="Microsoft.VSTS.Common.Priority" type="Integer" reportable="dimension">
                <HELPTEXT>Importance to business.</HELPTEXT>
                <ALLOWEDVALUES expanditems="true">
                    <LISTITEM value="1"/>
                    <LISTITEM value="2"/>
                    <LISTITEM value="3"/>
                    <LISTITEM value="4"/>
                </ALLOWEDVALUES>
                <WHEN field="System.Rev" value="" >
                  <COPY from="value" value="2" />
                </WHEN>
            </FIELD>
          <FIELD name="Stack Rank" refname="Microsoft.VSTS.Common.StackRank" type="Double" reportable="dimension">
            <HELPTEXT>Work first on items with lower-valued stack rank. Set in triage.</HELPTEXT>
          </FIELD>
          <FIELD name="Start Date" refname="Microsoft.VSTS.Scheduling.StartDate" type="DateTime" reportable="dimension">
                <HELPTEXT>The date to start the task</HELPTEXT>
            </FIELD>
            <FIELD name="Finish Date" refname="Microsoft.VSTS.Scheduling.FinishDate" type="DateTime" reportable="dimension">
                <HELPTEXT>The date to finish the task</HELPTEXT>
            </FIELD>

            <FIELD name="Changed Date" refname="System.ChangedDate" type="DateTime" />
            <FIELD name="Changed By" refname="System.ChangedBy" type="String" syncnamechanges="true">
                <VALIDUSER />
                <ALLOWEXISTINGVALUE />
            </FIELD>
            <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime" />
            <FIELD name="Created By" refname="System.CreatedBy" type="String" syncnamechanges="true" />
            <FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
                <WHENCHANGED field="System.State">
                    <SERVERDEFAULT from="clock" />
                </WHENCHANGED>
                <WHENNOTCHANGED field="System.State">
                    <READONLY />
                </WHENNOTCHANGED>
            </FIELD>
            <FIELD name="Activated Date" refname="Microsoft.VSTS.Common.ActivatedDate" type="DateTime" reportable="dimension">
                <WHENNOTCHANGED field="System.State">
                    <READONLY />
                </WHENNOTCHANGED>
            </FIELD>
            <FIELD name="Activated By" refname="Microsoft.VSTS.Common.ActivatedBy" type="String" syncnamechanges="true" reportable="dimension">
                <WHENNOTCHANGED field="System.State">
                    <READONLY />
                </WHENNOTCHANGED>
                <ALLOWEXISTINGVALUE />
            </FIELD>
            <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
                <WHENNOTCHANGED field="System.State">
                    <READONLY />
                </WHENNOTCHANGED>
            </FIELD>
            <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" syncnamechanges="true" reportable="dimension">
                <WHENNOTCHANGED field="System.State">
                    <READONLY />
                </WHENNOTCHANGED>
                <ALLOWEXISTINGVALUE />
            </FIELD>
        </FIELDS>
        <WORKFLOW>
            <STATES>
                <STATE value="Active">
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
                            <EMPTY />
                        </FIELD>
                        <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
                            <EMPTY />
                        </FIELD>
                    </FIELDS>
                </STATE>
                <STATE value="Closed" />
            </STATES>
            <TRANSITIONS>
                <TRANSITION from="" to="Active">
                    <REASONS>
                        <DEFAULTREASON value="New" />
                    </REASONS>
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
                            <COPY from="currentuser" />
                            <VALIDUSER />
                            <REQUIRED />
                        </FIELD>
                        <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
                            <SERVERDEFAULT from="clock" />
                        </FIELD>
                        <FIELD refname="System.AssignedTo">
                            <DEFAULT from="currentuser" />
                        </FIELD>
                    </FIELDS>
                </TRANSITION>
                <TRANSITION from="Active" to="Closed">
                    <ACTIONS>
                        <ACTION value="Microsoft.VSTS.Actions.Checkin" />
                    </ACTIONS>
                    <REASONS>
                        <DEFAULTREASON value="Completed" />
                        <REASON value="Cut" />
                        <REASON value="Deferred" />
                        <REASON value="Obsolete" />
                    </REASONS>
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
                            <READONLY />
                        </FIELD>
                        <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
                            <READONLY />
                        </FIELD>
                        <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
                            <SERVERDEFAULT from="clock" />
                        </FIELD>
                        <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
                            <COPY from="currentuser" />
                            <VALIDUSER />
                            <REQUIRED />
                        </FIELD>
                    </FIELDS>
                </TRANSITION>
                <TRANSITION from="Closed" to="Active">
                    <REASONS>
                        <DEFAULTREASON value="Reactivated" />
                    </REASONS>
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
                            <COPY from="currentuser" />
                            <VALIDUSER />
                            <REQUIRED />
                        </FIELD>
                        <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
                            <SERVERDEFAULT from="clock" />
                        </FIELD>
                        <FIELD refname="System.AssignedTo">
                            <COPY from="field" field="Microsoft.VSTS.Common.ClosedBy" />
                        </FIELD>
                    </FIELDS>
                </TRANSITION>
            </TRANSITIONS>
        </WORKFLOW>
        <FORM>
            <Layout>
                <Group>
                    <Column PercentWidth="80">
                        <Control FieldName="System.Title" Type="FieldControl" Label="&amp;Title:" LabelPosition="Left" />
                    </Column>
                    <Column PercentWidth="20">
                        <Control FieldName="Microsoft.VSTS.Common.Activity" Type="FieldControl" Label="Activit&amp;y:" LabelPosition="Left" />
                    </Column>
                </Group>
                <Group>
                    <Column PercentWidth="50">
                        <Group Label="Status">
                            <Column PercentWidth="100">
                                <Control FieldName="System.AssignedTo" Type="FieldControl" Label="Assi&amp;gned To:" LabelPosition="Left" />
                                <Control FieldName="System.State" Type="FieldControl" Label="&amp;State:" LabelPosition="Left" />
                                <Control FieldName="System.Reason" Type="FieldControl" Label="&amp;Reason:" LabelPosition="Left" />
                            </Column>
                        </Group>
                    </Column>
                    <Column PercentWidth="50">
                        <Group Label="Classification">
                            <Column PercentWidth="100">
                                <Group>
                                    <Column PercentWidth="100">
                                        <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="&amp;Area:" LabelPosition="Left" />
                                        <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="&amp;Iteration:" LabelPosition="Left" />
                                    </Column>
                                </Group>
                            </Column>
                        </Group>
                    </Column>
                </Group>
                <Group>
                    <Column PercentWidth="50">
                        <Group Label="Planning">
                          <Column PercentWidth="50">
                            <Control FieldName="Microsoft.VSTS.Common.StackRank" Type="FieldControl" Label="Stack Ran&amp;k:" LabelPosition="Left" NumberFormat="DecimalNumbers" MaxLength="10" />
                          </Column>
                          <Column PercentWidth="50">
                                <Control FieldName="Microsoft.VSTS.Common.Priority" Type="FieldControl" Label="&amp;Priority:" LabelPosition="Left" />
                            </Column>
                        </Group>
                    </Column>
                    <Column PercentWidth="50">
                        <Group Label="Effort (Hours)">
                            <Column PercentWidth="33">
                                <Control FieldName="Microsoft.VSTS.Scheduling.OriginalEstimate" Type="FieldControl" Label="Original &amp;Estimate:" LabelPosition="Left" />
                            </Column>
                            <Column PercentWidth="33">
                                <Control FieldName="Microsoft.VSTS.Scheduling.RemainingWork" Type="FieldControl" Label="Re&amp;maining:" LabelPosition="Left" />
                            </Column>
                            <Column PercentWidth="33">
                                <Control FieldName="Microsoft.VSTS.Scheduling.CompletedWork" Type="FieldControl" Label="Comp&amp;leted:" LabelPosition="Left" />
                            </Column>
                        </Group>
                    </Column>
                </Group>
                <TabGroup>
                    <Tab Label="Details">
                        <Group>
                            <Column PercentWidth="50">
                                <Group>
                                    <Column PercentWidth="100">
                                        <Control FieldName="System.Description" Type="HtmlFieldControl" Label="&amp;Description:" LabelPosition="Top" Dock="Fill" />
                                    </Column>
                                </Group>
                            </Column>
                            <Column PercentWidth="50">
                                <Group>
                                    <Column PercentWidth="100">
                                        <Control FieldName="System.History" Type="WorkItemLogControl" Label="&amp;History:" LabelPosition="Top" Dock="Fill" />
                                    </Column>
                                </Group>
                            </Column>
                        </Group>
                    </Tab>
                    <Tab Label="Implementation">
                        <Control Type="LinksControl" Name="Hierarchy" Label="Parents and &amp;Child Tasks:" LabelPosition="Top">
                            <LinksControlOptions>
                                <WorkItemLinkFilters FilterType="include">
                                    <Filter LinkType="System.LinkTypes.Hierarchy" />
                                </WorkItemLinkFilters>
                                <ExternalLinkFilters FilterType="excludeAll"/>
                                <LinkColumns>
                                    <LinkColumn RefName="System.ID" />
                                    <LinkColumn RefName="System.WorkItemType" />
                                    <LinkColumn RefName="System.Title" />
                                    <LinkColumn RefName="System.AssignedTo" />
                                    <LinkColumn RefName="System.State" />
                                    <LinkColumn LinkAttribute="System.Links.Comment" />
                                </LinkColumns>
                            </LinksControlOptions>
                        </Control>
                    </Tab>
                    <Tab Label="Other Links">
                        <Group>
                            <Column PercentWidth="100">
                                <Control Type="LinksControl" Name="GeneralLinks">
                                    <LinksControlOptions>
                                        <WorkItemLinkFilters FilterType="exclude">
                                            <Filter LinkType="System.LinkTypes.Hierarchy" />
                                            <Filter LinkType="Microsoft.VSTS.TestCase.SharedStepReferencedBy" />
                                            <Filter LinkType="Microsoft.VSTS.Common.TestedBy" FilterOn="reversename" />
                                        </WorkItemLinkFilters>
                                        <LinkColumns>
                                            <LinkColumn RefName="System.ID" />
                                            <LinkColumn RefName="System.WorkItemType" />
                                            <LinkColumn RefName="System.Title" />
                                            <LinkColumn RefName="System.AssignedTo" />
                                            <LinkColumn RefName="System.State" />
                                            <LinkColumn LinkAttribute="System.Links.Comment" />
                                        </LinkColumns>
                                    </LinksControlOptions>
                                </Control>
                            </Column>
                        </Group>
                    </Tab>
                    <Tab Label="Attachments">
                        <Control Type="AttachmentsControl" LabelPosition="Top" />
                    </Tab>
                  <Tab Label="TMap Testing Guidance">
                    <Control Type="WebpageControl" FieldName="Sogeti.TMap.GuidanceLink">
                      <WebpageControlOptions AllowScript="true" ReloadOnParamChange="false">
  <Link UrlRoot="http://tmap.codeplex.com/Wiki/Print.aspx?" UrlPath="{0}">
    <Param Index="0" Value="Sogeti.TMap.GuidanceLink" />
  </Link>
</WebpageControlOptions>

                    </Control>
                  </Tab>
                </TabGroup>
            </Layout>
        </FORM>
    </WORKITEMTYPE>
</WITD>
